﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Net.IRepository;
using Net.IService;
using Net.Model.Entities.Enterprises;
using Net.Model.ViewModels.Basic;
using Net.Model.ViewModels.Licenses;

namespace Net.Service
{
    public class LicenseService: BaseServices<AppLicenses>, ILicenseService
    {
        private readonly ILicenseRepository _licenseRepository;
        private readonly IUnitOfWork _unitOfWork;
        public LicenseService(ILicenseRepository licenseRepository, IUnitOfWork unitOfWork)
        {
            this._licenseRepository = licenseRepository;
            base.BaseDal = licenseRepository;
            this._unitOfWork = unitOfWork;
        }

        public async Task<AppProductLine> AddProductLine(AppProductLine productLine)
        {
            return await _licenseRepository.AddProductLine(productLine);
        }

        public async Task<IPageList<LicenseDto>> QueryAppLicensesByEnterpriseName(string enterpriseName)
        {
            return await _licenseRepository.QueryAppLicensesByEnterpriseName(enterpriseName);
        }

        public async Task<List<AppProductLine>> QueryProductLinesByLicenseIds(long[] licenseIds)
        {
            return await _licenseRepository.QueryProductLinesByLicenseIds(licenseIds);
        }
    }
}
